
class Solution {
    public int add(int a, int b) {
        int sum = 0; //记录不考虑进位的和
        int carry = 0;//记录进位
        do {
            sum = a ^ b; //不考虑进位的和
            carry = (a & b) << 1; //进位
            a = sum;
            b = carry;
        } while (b != 0);//存在进位就继续
        return a;
    }
}